def options(opt):
	opt.load('compiler_c')

def configure(conf):
	conf.load('compiler_c')
	conf.env.append_unique('CFLAGS', ['-Wall','-g'])
	if not conf.check(lib='cmocka', mandatory=False):
		conf.env.SKIP_TEST = "yes"

def build(bld):
	if bld.env.SKIP_TEST in ["yes"]:
		print("Skipping test: Cmocka library required")
		return
	bld.program(source='''cm_unity.c cm_data.c  cm_sign_azure.c cm_sign_s3.c
			      cm_file.c cm_xml.c''',
		    target='cm_unity',
		    lib=['curl', 'crypto', 'cmocka', 'expat'],
		    use=['ccan', 'elasto', 'elasto_file'],
		    includes = '. .. ../lib',
		    install_path = None)
